package com.eastfair.auth.dto;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Data;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.eastfair.auth.enumeration.HttpMethod;
import com.eastfair.auth.enumeration.LogType;
import java.io.Serializable;

/**
 * <p>
 * 实体类
 * 业务日志记录
 * </p>
 *
 * @author ligang
 * @since 2023-02-13
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "SystemLogSaveDTO", description = "业务日志记录")
public class SystemLogSaveDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 请求IP
     */
    @ApiModelProperty(value = "请求IP")
    @Size(max = 255, message = "请求IP长度不能超过255")
    private String requestIp;
    /**
     * 后台处理IP
     */
    @ApiModelProperty(value = "后台处理IP")
    @Size(max = 255, message = "后台处理IP长度不能超过255")
    private String ipAddr;
    /**
     * 链路追踪id
     */
    @ApiModelProperty(value = "链路追踪id")
    @Size(max = 255, message = "链路追踪id长度不能超过255")
    private String traceId;
    /**
     * 类型 #LogType{OPT:操作类型;EX:异常类型}
     */
    @ApiModelProperty(value = "类型 #LogType{OPT:操作类型;EX:异常类型}")
    private LogType type;
    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @NotNull(message = "请填写用户id")
    private Long userId;
    /**
     * 操作人
     */
    @ApiModelProperty(value = "操作人")
    @Size(max = 255, message = "操作人长度不能超过255")
    private String userName;
    /**
     * 操作描述
     */
    @ApiModelProperty(value = "操作描述")
    @Size(max = 1255, message = "操作描述长度不能超过1255")
    private String description;
    /**
     * 类路径
     */
    @ApiModelProperty(value = "类路径")
    @Size(max = 255, message = "类路径长度不能超过255")
    private String classPath;
    /**
     * 请求类型
     */
    @ApiModelProperty(value = "请求类型")
    @Size(max = 255, message = "请求类型长度不能超过255")
    private String actionMethod;
    /**
     * 请求地址
     */
    @ApiModelProperty(value = "请求地址")
    @Size(max = 255, message = "请求地址长度不能超过255")
    private String requestUri;
    /**
     * 请求类型#HttpMethod{GET:GET请求;POST:POST请求;PUT:PUT请求;DELETE:DELETE请求;PATCH:PATCH请求;TRACE:TRACE请求;HEAD:HEAD请求;OPTIONS:OPTIONS请求;}
     */
    @ApiModelProperty(value = "请求类型#HttpMethod{GET:GET请求;POST:POST请求;PUT:PUT请求;DELETE:DELETE请求;PATCH:PATCH请求;TRACE:TRACE请求;HEAD:HEAD请求;OPTIONS:OPTIONS请求;}")
    private HttpMethod httpMethod;
    /**
     * 请求参数
     */
    @ApiModelProperty(value = "请求参数")
    @Size(max = 1255, message = "请求参数长度不能超过1255")
    private String params;
    /**
     * 返回值
     */
    @ApiModelProperty(value = "返回值")
    @Size(max = 255, message = "返回值长度不能超过255")
    private String result;
    /**
     * 异常描述
     */
    @ApiModelProperty(value = "异常描述")
    @Size(max = 255, message = "异常描述长度不能超过255")
    private String exDetail;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime startTime;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime finishTime;
    /**
     * 消耗时间
     */
    @ApiModelProperty(value = "消耗时间")
    private Integer consumingTime;
    /**
     * 浏览器
     */
    @ApiModelProperty(value = "浏览器")
    @Size(max = 255, message = "浏览器长度不能超过255")
    private String ua;
    /**
     * 是否成功 1是 0否
     */
    @ApiModelProperty(value = "是否成功 1是 0否")
    private Integer isSuccess;
    /**
     * 是否启用 1是 0否
     */
    @ApiModelProperty(value = "是否启用 1是 0否")
    private Integer isEnabled;
    /**
     * 是否删除 1是 0否
     */
    @ApiModelProperty(value = "是否删除 1是 0否")
    private Integer isDeleted;
    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    private Long tenantId;
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    private Long projectId;
    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    private Long subsystemId;
    /**
     * 团队id
     */
    @ApiModelProperty(value = "团队id")
    private Long teamId;

}
